package com.xliu.csopenproject.pim_server.image.meta.impl;

public interface ParseFunction<R> {
    R apply(String data);
}

// no parse
class Ident implements ParseFunction<String> {
    public static final Ident INSTANCE = new Ident();

    @Override
    public String apply(String data) {
        return data;
    }
}

// 1080 pixels
class DropSuffix implements ParseFunction<Integer> {
    public static final DropSuffix INSTANCE = new DropSuffix();

    @Override
    public Integer apply(String data) {
        return Integer.parseInt(data.split(" ")[0]);
    }
}